﻿@model Project_2._2.ViewModels.PasswordChange_ViewModels
@{
    ViewBag.Title = "Đổi Mật Khẩu";
    Layout = "~/Views/Shared/_UserLayoutPage2.cshtml";
}

@*validate by jquery*@
<link href="~/Content/Validate%20Javascript/validationEngine.jquery.css" rel="stylesheet" />
<script src="~/Script/Validate%20Javascript/jquery-1.8.2.min.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine-vi.js"></script>
@*goi su kien form click de kt validate*@
<script>
    jQuery(document).ready(function () {
        // binds form submission and fields to the validation engine
        jQuery("#form1").validationEngine();
    });
  
</script>

<div class="ContentLeft-child">
    <div class="ContentRight-child-head">Đổi Mật Khẩu</div>
    <div class="ContentRight-child-logo"></div>
    <div class="ContentRight-child-body Box_sp" >
        
        @using (Html.BeginForm("DoiMatKhau", "TaiKhoan", FormMethod.Post, new  { id = "form1" }))
        {
            @Html.ValidationSummary(true);
            @Html.AntiForgeryToken();
        <table  style="padding:10px 0 15px 50px ; line-height:35px">
            <tr>
                <td class="align-right">@Html.LabelFor(m => m.OldPassword) &nbsp;<span style="color:red">*</span></td>
                <td>
                    @Html.PasswordFor(m => m.OldPassword, new { @class = "Textbox validate[required,minSize[6],maxSize[12]]" })
                    @Html.ValidationMessageFor(m => m.OldPassword)
                </td>
            </tr>
            <tr>
                <td class="align-right">@Html.LabelFor(m => m.NewPassword)&nbsp;<span style="color:red">*</span></td>
                <td>
                    @Html.PasswordFor(m => m.NewPassword, new { @class = "Textbox validate[required,minSize[6],maxSize[12]]" })
                    @Html.ValidationMessageFor(m => m.NewPassword)
                </td>
            </tr>
            <tr>
                <td class="align-right">@Html.LabelFor(m => m.Con_New_Password)&nbsp;<span style="color:red">*</span></td>
                <td>
                    @Html.PasswordFor(m => m.Con_New_Password, new { @class = "Textbox validate[required,equals[NewPassword]]" })
                    @Html.ValidationMessageFor(m => m.Con_New_Password)
                </td>
            </tr>
            <tr>
                <td class="align-right">@Html.LabelFor(m => m.captcha)&nbsp;<span style="color:red">*</span></td>
                <td>
                    @Html.TextBoxFor(m => m.captcha, new { @class = "Textbox validate[required]", @style = "width:80px" })
                    <img ID="Img3" alt="Captcha image" src="../Captcha/Captcha"  style=" margin-bottom:-10px; height:29px;border-radius:4px;" />
                    @Html.ValidationMessage("Captcha")
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" class="Button" value="Gửi Yêu cầu" />
                </td>
            </tr>

        </table>
        }
    </div>
</div>
@if (!string.IsNullOrEmpty(ViewBag.alert))
{
    <input id="alert" type="hidden" value="@ViewBag.alert" />
    <script type="text/javascript">
        var a = document.getElementById("alert").value;
        alert(a);
    </script>
}